/*   1:    */ package com.tanke;
/*   2:    */ 
/*   3:    */ class Shot
/*   4:    */   implements Runnable
/*   5:    */ {
/*   6:    */   int x;
/*   7:    */   int y;
/*   8:    */   int direct;
/*   9:102 */   int speed = 2;
/*  10:103 */   boolean isLive = true;
/*  11:104 */   String drawStr = this.x + "," + this.y;
/*  12:    */   
/*  13:    */   public int getSpeed()
/*  14:    */   {
/*  15:106 */     return this.speed;
/*  16:    */   }
/*  17:    */   
/*  18:    */   public void setSpeed(int speed)
/*  19:    */   {
/*  20:109 */     this.speed = speed;
/*  21:    */   }
/*  22:    */   
/*  23:    */   public Shot(int x, int y, int direct)
/*  24:    */   {
/*  25:113 */     this.x = x;
/*  26:114 */     this.y = y;
/*  27:115 */     this.direct = direct;
/*  28:    */   }
/*  29:    */   
/*  30:    */   public void run()
/*  31:    */   {
/*  32:119 */     while (this.isLive)
/*  33:    */     {
/*  34:    */       try
/*  35:    */       {
/*  36:122 */         Thread.sleep(50L);
/*  37:    */       }
/*  38:    */       catch (InterruptedException e)
/*  39:    */       {
/*  40:125 */         e.printStackTrace();
/*  41:    */       }
/*  42:128 */       switch (this.direct)
/*  43:    */       {
/*  44:    */       case 0: 
/*  45:131 */         this.y -= this.speed;
/*  46:132 */         break;
/*  47:    */       case 1: 
/*  48:134 */         this.x += this.speed;
/*  49:135 */         break;
/*  50:    */       case 2: 
/*  51:137 */         this.y += this.speed;
/*  52:138 */         break;
/*  53:    */       case 3: 
/*  54:140 */         this.x -= this.speed;
/*  55:    */       }
/*  56:144 */       if ((this.x <= 0) || (this.x >= 400) || (this.y <= 0) || (this.y >= 400))
/*  57:    */       {
/*  58:146 */         this.isLive = false;
/*  59:147 */         break;
/*  60:    */       }
/*  61:    */     }
/*  62:    */   }
/*  63:    */ }


/* Location:           C:\Users\Cheese\Desktop\坦克大战\坦克大战.jar
 * Qualified Name:     com.tanke.Shot
 * JD-Core Version:    0.7.0.1
 */